import 'package:get/get.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';

abstract class BaseRefreshController extends FullLifeCycleController {
  RefreshController refreshController = RefreshController();
  int loadStatus = 0;

  @override
  onInit() {
    super.onInit();
    fetchData();
  }

  /// 下拉刷新
  onRefresh() {
    fetchData(showLoading: false);
  }

  /// 上拉加载
  onLoadMore() {}

  /// 失败重试
  onRetry() {
    fetchData();
  }

  /// 加载数据
  fetchData({bool showLoading = true}) {}
}
